from tkinter import *


root=Tk()
root.title("ИТ марафон")
root.geometry("500x500")

canvas=Canvas(bg="white",width=500,height=500)
canvas.pack(anchor=CENTER,expand=1)

x=int(input("введите смещение по X: "))
y=int(input("введите смещение по Y: "))
n=int(input("введите коэффицент увеличения n: "))

if n>=0 and 0*n+x>=0 and 0*n+y>=0 and 30*n+x<=500 and 20*n+y<=500:
   x1,y1=0*n+x,0*n+y
   x2,y2=10*n+x,0*n+y
   x3,y3=10*n+x,10*n+y
   x4,y4=20*n+x,10*n+y
   x5,y5=20*n+x,0*n+y
   x6,y6=30*n+x,0*n+y
   x7,y7=30*n+x,20*n+y
   x8,y8=0*n+x,20*n+y
   canvas.create_polygon(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)

elif n<0 and 0*abs(n)+x>=0  and 0*abs(n)+y>=0 and 30*abs(n)+x<=500  and 20*abs(n)+y<=500:
   n=-n
   x1,y1=0*n+x,0*n+y
   x2,y2=10*n+x,0*n+y
   x3,y3=10*n+x,10*n+y
   x4,y4=20*n+x,10*n+y
   x5,y5=20*n+x,0*n+y
   x6,y6=30*n+x,0*n+y
   x7,y7=30*n+x,20*n+y
   x8,y8=0*n+x,20*n+y
   canvas.create_polygon(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)
else:
     print("Размер фигуры превышает максимальный размер поля")
root.mainloop()
